import request from '@/utils/request'

// 查询库存信息列表
export function listInventory(query) {
  return request({
    url: '/wms/inventory/list',
    method: 'get',
    params: query
  })
}

// 查询库存信息详细
export function getInventory(inventoryId) {
  return request({
    url: '/wms/inventory/' + inventoryId,
    method: 'get'
  })
}

// 新增库存信息
export function addInventory(data) {
  return request({
    url: '/wms/inventory',
    method: 'post',
    data: data
  })
}

// 修改库存信息
export function updateInventory(data) {
  return request({
    url: '/wms/inventory',
    method: 'put',
    data: data
  })
}

// 删除库存信息
export function delInventory(inventoryIds) {
  return request({
    url: '/wms/inventory/' + inventoryIds,
    method: 'delete'
  })
}

// 库存入库
export function inboundInventory(data) {
  return request({
    url: '/wms/inventory/inbound',
    method: 'post',
    data: data
  })
}

// 库存出库
export function outboundInventory(data) {
  return request({
    url: '/wms/inventory/outbound',
    method: 'post',
    data: data
  })
}

// 冻结库存
export function freezeInventory(data) {
  return request({
    url: '/wms/inventory/freeze',
    method: 'post',
    data: data
  })
}

// 解冻库存
export function unfreezeInventory(data) {
  return request({
    url: '/wms/inventory/unfreeze',
    method: 'post',
    data: data
  })
}

// 根据条件查询库存
export function getInventoryByCondition(query) {
  return request({
    url: '/wms/inventory/condition',
    method: 'get',
    params: query
  })
}